var express = require('express');
var router = new express.Router();
var Mock = require('mockjs')


router.get('/list', function (req, res) {
  var member = Mock.mock({
    'list|5': [{
      name:'@cname',
      age: '@natural(20,50)',
      'gender|1':['男','女'],
      'phoneNumber':/\d{11}/,
      email:'@email',
      address:'@county(true)',
    }]
  })


  res.send(member.list);

})

//var member=require('./data/employee')
var member=[];

router.get('/add',function (request,response) {
  console.log(request.query);
  member.unshift(request.query)
  response.send({
    emps:member,
    flag:true
  })
})


module.exports= router;
//module.exports = member.list;
